<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        function getType(value) {
            if (value === null) {
                return "null";
            }

            if(typeof value === "object")
            {
                let valueClass = value.__proto__.toString();
                let res = valueClass.split(" ")[1].split("")
                res.pop()
                res = res.join("")
                return res;
            }
            else{
                return typeof value;
            }
        }

        let a = { name : "小明"}
        console.log(getType(a))
    </script>
</body>

</html>